import DS from 'ember-data';
import BaseModel from './base-model';

var Room = BaseModel.extend({
  name:DS.attr('string'),//名称
  price:DS.attr('string'),//价格
  createDateTime:DS.attr('number'),//创建时间
  createUser:DS.belongsTo('user'),//创建人
  lastUpdateDateTime:DS.attr('number'),//更新时间
  lastUpdateUser:DS.belongsTo('user'),//更新人
  scannerID:DS.attr('number'),//小米scanner id
  floor:DS.belongsTo('floor'),//所属楼层
  roomType:DS.belongsTo('dicttypetenant'),//房屋类型
  // nursingType:DS.belongsTo('dicttype'),//护理类型
  // bed:DS.hasmany('bed'),//
  remark:DS.attr('string'),//备注
  beds:DS.hasMany("bed"),
  orientation:DS.belongsTo('dicttype'),//房屋朝向
  oldType:DS.belongsTo('dicttype'),//老人护理类型
  isGroupFlag:DS.attr('string'),//是否有护理组护理
  facility:DS.attr('string'),//房屋配备设施
  area:DS.attr('number'),//房屋面积
  publicType:DS.belongsTo('dicttypetenant'),//公共区域类别
  isPublicFlag:DS.attr('number'),//是否公共区域 1：公共区域 0：正常房屋
  nurseGroup:DS.belongsTo('nursegroup',{
    inverse:'rooms'
  }),//护工组ID
  allName:Ember.computed('name','floor',function(){
    var name=this.get('floor.building.name')+'-'+this.get('floor.name')+'-'+this.get('name');
    return name;
  })
});

export default Room;
